﻿package bacIns 
{
	import flash.display.MovieClip;
	import flash.text.TextField;
	import game.exchangeddata.HashTable;
	import game.exchangeddata.TableInfo;
	/**
	 * ...
	 * @author Nguyen Thi Bich Phuong (Daisy)
	 */
	public class BacTableInfoPanel extends MovieClip {
		public var txtTableNameTf:TextField;
		public var txtTableInfoTf:TextField;
		public var txtMinBetTf:TextField;
		public var txtMaxBetTf:TextField;
		
		public var tableNameTf:TextField;
		public var tableInfoTf:TextField;
		public var minBetTf:TextField;
		public var maxBetTf:TextField;
		
		public var dateTf:TextField;
		public var clockTf:TextField;
		
		public function BacTableInfoPanel() { 
			this.tableNameTf.mouseEnabled = false;
			this.tableInfoTf.mouseEnabled = false;
			this.minBetTf.mouseEnabled = false;
			this.maxBetTf.mouseEnabled = false;
			
			this.txtMaxBetTf.mouseEnabled = false;
			this.txtTableInfoTf.mouseEnabled = false;
			this.txtMinBetTf.mouseEnabled = false;
			this.txtMaxBetTf.mouseEnabled = false;
			
			this.dateTf.mouseEnabled = false;
			this.clockTf.mouseEnabled = false;		
		}
		
		/**
		 * @author Daisy
		 * @param	tableinfo
		 * @usage This function to display table information into gameview
		 */
		public function updateTableInfo(tableinfo:TableInfo):void {			
			this.tableNameTf.text = tableinfo.tableName;
			this.tableInfoTf.text = tableinfo.gameSet + " - " + tableinfo.gameNo;			
		}			
		
		public function updateDateClock(tableinfo:TableInfo):void {
			this.dateTf.text = tableinfo.dateGame;
			this.clockTf.text = tableinfo.clockGame;	
		}	
		
		public function updateTableMinMax(minBet:Number, maxBet:Number):void {
			this.minBetTf.text = minBet + "";
			this.maxBetTf.text = maxBet + "";
		}		
		
		/**
		 * @author Daisy
		 * @param	hashTableInfo
		 */
		public function initText(hashTableInfo:HashTable):void {
			this.txtTableNameTf.text = hashTableInfo.lookupString("INFOtable");
			this.txtTableInfoTf.text = hashTableInfo.lookupString("INFOgame");
			this.txtMinBetTf.text = hashTableInfo.lookupString("INFOMinbet");
			this.txtMaxBetTf.text = hashTableInfo.lookupString("INFOMaxbet");
		}
	}
}